import request from '@/utils/request'

export function loginByUsername(data) {
  return request({
    url: '/auth/login',
    method: 'post',
    data
  })
}

export function logout() {
  return request({
    url: '/auth/logout',
    method: 'post'
  })
}

export function getUserInfo() {
  return request({
    url: '/auth/me',
    method: 'get'
  })
}

export function loginProxy(companyId) {
  return request({
    url: '/auth/loginProxy',
    method: 'get',
    params: { companyId }
  })
}

export function getCaptcha() {
  return request({
    url: '/auth/captcha',
    method: 'get'
  })
}
